package io.renren.vo;

import io.renren.constant.AppConstant;

public class RespModel<T> {
    private String status;
    private String errorcode;
    private String reason;
    private T result;

    public RespModel() {

    }

    public RespModel(String status, String errorcode, String reason,
                     T result) {
        this.status = status;
        this.errorcode = errorcode;
        this.reason = reason;
        this.result = result;
    }

    public RespModel getRespModelInstance(AppConstant appConstant, String message, T obj) {
        this.status = appConstant.getName();
        this.errorcode = appConstant.getValue();
        this.reason = message;
        this.result = obj;
        return this;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getErrorcode() {
        return errorcode;
    }

    public void setErrorcode(String errorcode) {
        this.errorcode = errorcode;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public T getResult() {
        return result;
    }

    public void setResult(T result) {
        this.result = result;
    }
}
